Repository navigation
fix: comment retries, a stuck prefetch flag, a double feed fetch and compact errors, plus three behavior changes - #294
Merged
Conversation
therealsama
force-pushed
the
fix/verified-retry-prefetch-and-restore-bugs
branch
from
October 6, 2026 18:04
5bb49f2 to
fd98b6f
Compare
therealsama
force-pushed
the
fix/verified-retry-prefetch-and-restore-bugs
branch
2 times, most recently
from
November 1, 2026 02:50
5116bc4 to
acbc2c3
Compare
…compact errors, plus three behavior changes Four bug fixes and three behavior changes, each with its tests. The comments section's automatic retry called refresh(), which refetches the item and then its comments, and set the page-level error when the comments failed again, so ItemDetail and FullScreenItem replaced a story that had loaded with "Failed to load item". The section now retries the comments only, with a new retryComments(), and keeps the comments error set until each attempt settles. refresh() reports a comments failure after the item loads as a comments error, so the page's Try Again shows the story. A reconnect retry aborted the request that had registered a priority fetch and fetched again without one, so the count stayed up and background prefetching stayed off until the page was reloaded. The reconnect retry now releases the registration when it settles, whether it succeeds, fails or is aborted, and a comment item releases it once the item loads. On a phone the feed routes and /item/:id rendered different components, so the swipe viewer remounted when it moved the URL to its first story and fetched the feed's first page again. They now render one component, MobileStoryRoute, keyed by the times a feed route is entered from another route. A compact StateView showed its default title, "Something went wrong", in place of a passed-in description, so the comments error's "Failed to load comments" never showed. A passed-in description now takes the default title's place. The story lists' load-more error no longer passes its raw error, so it still reads "Something went wrong". Desktop Back from another feed now restores the feed's saved list instead of starting it over, as reset() had done since 03dbe95. The list is keyed by feed, so it mounts for each one and restores its session, cursor included. A header tab still starts its feed over. The desktop comment page keeps a comment it got from Firebase when Algolia fails. Its replies show their skeleton during the retries, then "Failed to load replies" with a Retry button, instead of the page error, which is left for a comment with nothing to show. The item cache stays within 3 million of the 5,242,880 characters of localStorage an origin gets, and doesn't keep a thread over half that. The feed lists, viewed times and theme choice write through setLocalStorageItem(), which drops the older half of the cached items and tries once more when storage is full.
therealsama
force-pushed
the
fix/verified-retry-prefetch-and-restore-bugs
branch
from
November 1, 2026 03:11
acbc2c3 to
287bbe0
Compare
therealsama
enabled auto-merge
November 1, 2026 18:54
kplachkov
approved these changes
Nov 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes four bugs, each reproduced by a test that fails on the unfixed code, and makes three behavior changes that are judgment calls.
Bug fixes
refresh(), which set the page-level error when the comments failed again. It now retries the comments only, with a newretryComments(), so the story stays.StateViewshowed its default title over a passed-in description, so "Failed to load comments" never showed (onmain, the bug above replaced the story first). A passed-in description now takes the default title's place. The story lists' load-more error, which its test has pinned to "Something went wrong" since May, no longer passes its raw error, so it's unchanged./item/:idrendered different components, so the swipe viewer remounted when it moved the URL to its first story. They now render one component,MobileStoryRoute.Behavior changes
reset()says "We're starting fresh, not restoring" (11d36b9), and 03dbe95's e2e test checks that Back drops the session.StoryListis now keyed by feed, so each feed restores its saved session, cursor included. A header tab still starts its feed over.setLocalStorageItem(), which drops the older half of the cached items and tries once more when storage is full. Pruning no longer parses every cached thread.Testing
retryComments()is new); the other 8 cover behavior that has to stay.MAX_CACHED_ITEMStest expects exactly 60 items (the old prune allowed 61), and the story list's in-list error test also checks the raw error isn't shown.Known limitations
useInfiniteStories'sreset()is no longer called by the app.MobileStoryRoutereads the saved swipe position only when it mounts, so one mounted on a feed route treats a later/item/:idwithout router state as a direct link. A reload mounts it fresh.